<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    <qq></qq>
</div>
<!-- 父组件 -->
<template id="box">
    <div>
        <h2>父组件{{cone}}</h2>
        <button @click="add">++</button>
        <ane :count="cone"></ane>
    </div>
</template>
<!-- 子组件 -->
<template id="box1">
    <div>
        <h4>子组件{{count}}</h4>
    </div>
</template>
<script>
    //子组件
    const Comm ={
        template:"#box1",
        props:["count"]
    }
    //父组件
    const Com ={
        template:'#box',
        components:{
            "ane":Comm
        },
        data() {
            return {
                cone:888
            }
        },  
        methods:{
            add(){
                this.cone += 1
            }
        }
    }
    new Vue({
        el:"#app",
        //注册组件
        components:{
            "qq":Com
        }
    })
</script>
</body>
</html>